// import request from '@/utils/request'
import request from '@/utils/request'

/**
 * @description 登录功能
 * @param {string, string} data: {mobile, password}
 * @returns Promise
 */
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'POST',
    data
  })
}

/**
 * @description: 获取用户资料
 * @param {*}
 * @return {*}
 */
export function getUserProfile() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}

/**
 * @description 获取员工基本信息
 * @param {string, number} id
 * @returns Promise
 */
export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'GET'
  })
}

/**
 * 给员工分配角色
 * @param {*} data
 * @returns
 */
export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}

export function getInfo(token) {

}

export function logout() {

}
